package my.package0331;
import java.util.Scanner;
public class dome6 {
    //顾客从超市采购了10件商品， 编写一个程序， 用于接受每件商品的价格，计算应付的总金额。 并分别打印出各个商品的价格以及应付的总金额。
    public static  void main(String args[]) {
        String a[]={"a","b","c","d","e","f","g","h","i","j"};
            Scanner scanner = new Scanner(System.in);
            double b []=new double[10];
            for (int i=0;i<a.length;i++){
                System.out.print("请输入"+a[i]+"的价格：");
                b[i]=scanner.nextDouble();
            }
            double sum=0;
            for (int i=0;i<a.length;i++){
                System.out.println(a[i]+"的价格："+b[i]+"元");
                sum=sum+b[i];
            }
            System.out.println("总金额："+sum+"元");
    }
}
